package start.demo01.datatype;

import org.junit.Test;

import java.util.UUID;

public class StringTest {

    private int a=100;

    private String str;

    private static void ttt(String s){
        s="00";
    }

    @Test
    public void t7(){
        String r="e21";
        ttt(r);
        System.out.println(r);
    }

    public static void main(String[] args){
        StringTest st=new StringTest();
        System.out.println(st.a);
        se("1w","swq",""," ");
    }
    public static void se(String... s){
        for(String a:s){
            System.out.println(a+a.length());
        }
    }
    @Test public void t1(){
        String a1="www";
        a1.replace('w',' ');
        StringBuilder a2=new StringBuilder("www");
        StringBuffer a3=new StringBuffer("www");
        a2.append("qqq");
        a3.append(111);
        System.out.println(a2);
        System.out.println(a3);
    }
    @Test public void tt(){
        String a=new String("wq");
        String b="wq";
        System.out.println(a.intern() == b.intern());
    }

    @Test public void test(){
        String textString = new String("java");
        StringBuffer textBuffer = new StringBuffer("java");
        System.out.println(stringReplace(textString) + bufferReplace(textBuffer));
    }
    public static String stringReplace(String text) {
        return text.replace('j', 'L');
    }
    public static StringBuffer bufferReplace(StringBuffer text) {
        return text.append("c");
    }
    @Test public void main(){
        System.out.println();
    }

    @Test public void t2(){
        System.out.println("sd"=="sd");//"true"
    }
    @Test public void t3(){
        System.out.println(UUID.randomUUID().toString().replace("-","").toUpperCase());
    }

    @Test public void t4(){
        String s="sw"+null;
        System.out.println(s);
    }
    @Test public void t5(){
        String s=""+true;
        String s1=""+"true";
        System.out.println(s);
        System.out.println(s1);
    }
    @Test public void t6(){
        String format = String.format("%s.conf", "param.getName()");
        System.out.println(format);
    }
    @Test
    public void t8(){
        String s=null;
    }
}
